<?php /*
Template Name: Page - Detail
Author: Nmedia
*/?>

<?php get_header(); ?>

<script type="text/javascript">
function bigMe(src)
{
	$("#big-img").attr('src', src);
}
</script>
		<div class="breadcrumb_box clearfix">
            <div class="content-title">
            	<h1><?php the_title(); ?></h1>
            </div>
            <?php templ_set_breadcrumbs_navigation();?>
       </div>    
       <div class="shadowbox"></div> 
       <div class="page-detail">
	   <?php 
	   	$args['post__in']=array($_GET['pid']);
		query_posts($args);
	 	if ( have_posts() ):
		the_post();		////// get first post ie selected by id;
	   ?>       

			<div class="detail-images">
			<?php
		   		$args = array(
					'post_type'   => 'attachment',
					'numberposts' => -1,
					'post_parent' => $post->ID
					);
		 
				$attachments = get_posts( $args );
				if ( $attachments ):
				for($i=0;$i<count($attachments);$i++):
					$return=wp_get_attachment_image_src( $attachments[$i]->ID, 'medium' );
					if($i==0): 
            ?>
				<img src="<?php echo $return[0]; ?>" class="big-img" id="big-img">
            <?php 	else: ?>
				<img src="<?php echo $return[0]; ?>" width="75" onclick="bigMe(this.src)">
			<?php
					endif;
			endfor;
			else:
			?>
            <img src="http://www.franquicia-t.com/wp-content/uploads/2012/02/200px-No_image_available.svg_.png" class="big-img">
            <?php
			endif;					
			?>
            </div>
	        
	        <h1><?php the_title(); ?></h1>
            <p><?php echo the_content(); ?></p>
<!--	        <h3>Heading of the Post</h3>
            <p>Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor.Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor.Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor. </p>
	        <h3>Heading of the Post</h3>
            <p>Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor.Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor.Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor. Lorem ipsum dolor. </p>
-->	        
			<div class="clearfix"></div>
		<?php endif; ?>
		</div>


<?php get_footer(); ?>